package com.ls.demo.pattern.factory;

import java.util.Random;

/**
 * @program: simpleframework
 * @description:
 * @author: lishuang
 * @create: 2021-11-19 18:07
 **/

public class RootFactory implements GenericIFactory<String,Integer> {
    private String[] strings = new String[]{"hello","Hi"};
    private Integer[] integers = new Integer[]{111,110};
    @Override
    public String nextObject() {
        Random random = new Random();
        return strings[random.nextInt(2)];
    }

    @Override
    public Integer nextNumber() {
        Random random = new Random();
        return integers[random.nextInt(2)];
    }
}
